package com.HospitalOutpatient.dao;

import com.HospitalOutpatient.entity.Reception;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ReceptionDao {

    @Insert("insert into reception values (null,#{patientId},#{dutyId},null)")
    int insertReception(Reception reception);

    @Select("select * from reception where patientId = #{patientId}")
    List<Reception> selectReceptionByPatientId(String patientId);

    @Select("select * from reception where dutyId = #{dutyId} and diagnosisId is null")
    List<Reception> selectReceptionBydutyId(String dutyId);

    @Select("select * from reception where receptionId = #{receptionId}")
    Reception selectReceptionById(String receptionId);

    @Update("update reception set diagnosisId = #{diagnosisId} where receptionId = #{receptionId}")
    int updateDiagnosisToReception(Reception reception);

    @Delete("delete from reception where receptionId = #{receptionId}")
    int deleteReceptionById(String receptionId);

    @Select("select * from reception where dutyId = #{dutyId}")
    List<Reception> selectFinishReceptionBydutyId(String dutyId);

}
